A deduplicating storage file system (“storage appliance”) can support hundreds of mountable file system namespaces. Each namespace requires resources, such as volatile and non-volatile memory (NVRAM) to implement the namespace. A namespace can be implemented in an indexed structure such as a binary tree, a B−tree or a B+tree. A namespace often has an initial resource allocation that may be contiguous, that soon becomes fragmented as memory pages or disk sectors are added to, or deleted from, the namespace. Namespace fragmentation is distinct from fragmentation of the files that are referenced by the namespace.
A namespace, or a portion thereof, will be periodically written to storage to protect against corruption of the namespace due to a failure of the storage appliance, such as a power loss or disk failure. To efficiently store changes to numerous namespaces, the namespaces may be multiplexed before storing the namespace changes to storage containers. A container is a structure that is written once, and not modified thereafter. Thus, as each namespace becomes fragmented, and is written to storage, then each container may hold a plurality of namespaces each of which may be fragmented, further increasing the fragmentation of each namespace.